public class Solution1646 {
    public int getMaximumGenerated(int n) {
        int[] f=new int[105];
        if (n==0) return 0;
        if (n==1) return 1;
        f[0]=0;f[1]=1;
        int max=0;
        for (int i = 2; i <= n; i++) {
            if (i%2==0){
                f[i]=f[i/2];
            }else{
                f[i]=f[i/2]+f[i/2+1];
            }
            if (f[i]>max) max=f[i];
        }
        return max;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1646().getMaximumGenerated(7));
    }
}
